{include file="public/header" /}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 用户管理
    <span class="c-gray en">&gt;</span> 用户列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form  method="get" action="">
        <div class="text-c">
            日期范围：
            <input type="text" onfocus="WdatePicker()" value="{:input('get.start')}" name="start" id="datemin" class="input-text Wdate" style="width:120px;">
             -
            <input type="text" onfocus="WdatePicker()" value="{:input('get.end')}" name="end" id="datemax" class="input-text Wdate" style="width:120px;">
            <input type="text" class="input-text" style="width:250px" placeholder="UID/账号" value="{:input('word')}" name="word">

            <span class="select-box" style="width: 100px;">
                <select name="status" class="select">
                    <option value="0">全部</option>
                    <option value="1" {if isset($_GET['status']) && $_GET['status'] == 1}selected{/if}>未处理</option>
                    <option value="2" {if isset($_GET['status']) && $_GET['status'] == 2}selected{/if}>已处理</option>
                    <option value="3" {if isset($_GET['status']) && $_GET['status'] == 3}selected{/if}>已撤回</option>
                </select>
            </span>

            <button type="submit" class="btn btn-success">搜索</button>
        </div>
    </form>

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
        </span>
        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
            <tr>
                <th scope="col" colspan="1">账户列表</th>
                <th scope="col" colspan="9">总提 $ {$money}</th>
            </tr>
            <tr class="text-c">
                <th width="30">ID</th>
                <th width="50">账号 / 订单号</th>
                <th width="100">金额/人民币/手续费/需转</th>
                <th width="100">银行卡</th>
                <th width="100">状态</th>
                <th width="100">时间</th>
                <th width="100">操作</th>
            </tr>
        </thead>
        <tbody>
            {foreach $list as $v}
            <tr class="text-c">
                <td>{$v.ids}</td>
                <td>{$v.uid} / {$v.uname} <br> {$v.order_sn}</td>
                <td>$ {$v.num} / &yen; {$v.rmb}/ {$v.sxf} / <span style="font-size: 20px"> &yen; {$v.rmb-$v.sxf}</span> </td>
                <td class="text-l">
                    身份证：{$v.card} <br>
                    开户行：{:config('base.bank')[$v.khh]}  <br>
                    持卡名：{$v.name} <br>
                    银行卡：{$v.bank}
                </td>
                <td>
                    {switch $v.status}
                        {case 1}<span class="label label-warning radius">待处理</span>{/case}
                        {case 2}<span class="label label-success radius">已处理</span>{/case}
                        {case 3}<span class="label label-default radius">已撤回</span>{/case}
                        {default /}意外 {$v.status}
                    {/switch}
                </td>
                <td>{$v.createds}<br>{$v.updateds}</td>
                <td>
                    <a class="btn btn-default radius" title="编辑" href="javascript:;" onclick="member_start(this,{$v.ids},{$v.status})"><i class="Hui-iconfont">&#xe6df;</i></a>
                </td>
            </tr>
            {/foreach}
        </tbody>
    </table>
    <div class="page">
        {$list->render()|raw}
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">
function member_start(obj,id,status){
    layer.confirm('处理提现？',{btn: ['转账','撤回']},function(index){
        $.ajax({
            type: 'POST',
            url: "{:url('setCarry')}",
            data: {id:id,status:2},
            dataType: 'json',
            success: function(data){
                if(data.status == 'y'){
                    layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                        location.replace(location.href);
                    });
                }else{
                    layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                }
            },
            error:function(data) {
                console.log(data.msg);
            },
        });
    },function(){
        $.ajax({
            type: 'POST',
            url: "{:url('setCarry')}",
            data: {id:id,status:3},
            dataType: 'json',
            success: function(data){
                if(data.status == 'y'){
                    layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                        location.replace(location.href);
                    });
                }else{
                    layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                }
            },
            error:function(data) {
                console.log(data.msg);
            },
        });
    });
}

</script>